/**
 * Created by Administrator on 2016-12-23.
 */

const util = require('util');
function Parent() {

    this.age = 18;
    this.say = 66;
    console.log('Parent');
}

function Child() {
     Parent.call(this);
    this.age = 19;
    this.hello = function(){
        return this.age;
    }
}

Child.prototype.word = function () {
    return this.age;
}

// Child.prototype = new Parent();
//  Child.prototype.constructor = Child;

// util.inherits(Child, Parent);

Object.setPrototypeOf(Child.prototype,Parent.prototype)

var child = new Child();
//var child2 = new Child();
//console.log(child.word === child2.word)
/*console.log(child.hello == child2.hello)
console.log(child.hello())
console.log(Object.getOwnPropertyNames(child.__proto__))*/
console.log(child instanceof Parent)
console.log(child.constructor)